Skip to content

Try not to use c-style initializers #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 7, 2025
Merged

Conversation

fomichev
Copy link

@fomichev fomichev commented Jul 3, 2025

They are ok if they are in the same order as the fields. Otherwise g++ complains about them:
error: designator order for field ‘ynl_ntf_info::policy’ does not match declaration order in ‘ynl_ntf_info’

Use regular var.field = val style initializers. Also regenerate the libs.

Stanislav Fomichev added 3 commits July 2, 2025 13:22
More strict/old compilers do not like them:

error: designator order for field ‘ynl_policy_attr::type’ does not match declaration order in ‘ynl_policy_attr’
error: designator order for field ‘ynl_policy_attr::type’ does not match declaration order in ‘ynl_policy_attr

Signed-off-by: Stanislav Fomichev <[email protected]>
More strict/old compilers do not like them:

error: designator order for field ‘ynl_ntf_info::policy’ does not match declaration order in ‘ynl_ntf_info’

Signed-off-by: Stanislav Fomichev <[email protected]>
Signed-off-by: Stanislav Fomichev <[email protected]>
@kuba-moo
Copy link
Contributor

kuba-moo commented Jul 7, 2025

Build trips on ethtool. Looks like C++ fun?

@fomichev
Copy link
Author

fomichev commented Jul 7, 2025

The same issue that I hack up internally:

std::optional<hwtstamp_source> hwtstamp_source;

Should be:

std::optional<enum hwtstamp_source> hwtstamp_source;

(name shadows the type and we don't use type qualifiers enum/struct in the gen)

Let me see if I can fix it properly. If not, I'll manually edit the generated file...

There is a type and a field with the same name (hwtstamp_source):
  std::optional<hwtstamp_source> hwtstamp_source;

It needs to be the following to compile:
  we need std::optional<enum hwtstamp_source> hwtstamp_source;

Also, skip nl80211 gen, the spec is too complicated and ynl-gen-cpp
doesn't follow ynl_gen_c.py :-(

Signed-off-by: Stanislav Fomichev <[email protected]>
@fomichev
Copy link
Author

fomichev commented Jul 7, 2025

Added 2c8e6ef

The libs compile locally now

@kuba-moo kuba-moo merged commit 0d861ea into linux-netdev:main Jul 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants